package com.zeh.billing.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zeh.billing.entity.Cmoney;
import com.zeh.billing.entity.CmoneyVo;
import com.zeh.billing.entity.SearchDo;
import com.zeh.billing.mapper.CmoneyMapper;
import com.zeh.billing.service.CmoneyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zeh
 * @since 2021-08-26
 */
@Service
public class CmoneyServiceImpl extends ServiceImpl<CmoneyMapper, Cmoney> implements CmoneyService {

    @Autowired
    private  CmoneyMapper cmoneyMapper;

    @Override
    public IPage<CmoneyVo> searchMoney(SearchDo searchDo) { //用户编号
        Page page = new Page(searchDo.getCurrentPage(), searchDo.getPageSize());
        IPage<CmoneyVo> cmonies = cmoneyMapper.selectPage(page,new QueryWrapper<Cmoney>().lambda().eq(Cmoney::getCid,searchDo.getCid()).orderByDesc(Cmoney::getCreateTime));
         return cmonies;
    }

}
